package org.assocsp3.modele;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;

public class Personne{
     
    @Size(min=1, max=16)
    private String login;

    @Size(min=1, max=64)
    private String nom;
     
    @Size(min=1, max=64)
    private String prenom;
     
    @Email
    @Size(min=1, max=128)
    private String email;
     
    @Size(min=1, max=128)
    private String mdp;
     
    @Size(min=1, max=128)
    private String validmdp;

    @Valid
    private Adresse adresse;
     
    public Personne() {
    }

    public Personne(String nom, String prenom, String email) {
       this.nom = nom;
       this.prenom = prenom;
       this.email = email;
    }
    
    public Personne(String login,String mdp) {
		this.login=login;
		this.mdp=mdp;		
	}
    
    public Personne(Adresse adr) {
		this.adresse=adr;
	}
    public String getNom() {
        return this.nom;
    }
    
    public void setNom(String nom) {
        this.nom = nom;
    }
    public String getPrenom() {
        return this.prenom;
    }
    
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    public void setAdresse(Adresse adresse) {
		this.adresse = adresse;
	}

	public Adresse getAdresse() {
		return adresse;
	}

    public String getLogin() {
        return this.login;
    }
    
    public void setLogin(String login) {
        this.login = login;
    }
    
    public String getMdp() {
        return this.mdp;
    }
    
    public void setMdp(String mdp) {
        this.mdp = mdp;
    }

	public void setValidmdp(String validmdp) {
		this.validmdp = validmdp;
	}

	public String getValidmdp() {
		return validmdp;
	}

	public boolean memeMdp() {
		return (mdp.equals(validmdp));
	}

}
